<?php
//resoluciones view
defined('_JEXEC') or die('Restricted access'); ?>
<form action="index.php" method="post" name="adminForm">
    <div id="editcell">
        <table class="adminlist">
            <thead>
                <tr>

                    <th width="20">
                        <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
                    </th>
                    <th>
                        <?php echo JText::_( 'Numero' ); ?>
                    </th>
                    <th>
                        <?php echo JText::_( 'Fecha Resolucion' ); ?>
                    </th>
                    <th>
                        <?php echo JText::_( 'Vigencia Desde' ); ?>
                    </th>
                    <th>
                        <?php echo JText::_( 'Vigencia Hasta' ); ?>
                    </th>
                    <th>
                        <?php echo JText::_( 'Visto' ); ?>
                    </th>
                    <th>
                        <?php echo JText::_( 'Considerando' ); ?>
                    </th>
                    <th>
                        <?php echo JText::_( 'Observaciones' ); ?>
                    </th>
                    <th>
                        <?php echo JText::_( 'Materia' ); ?>
                    </th>
                    <th>
                        <?php echo JText::_( 'Cargo' ); ?>
                    </th>
                    <th>
                        <?php echo JText::_( 'Agente' ); ?>
                    </th>
                </tr>
            </thead>
            <?php
            $k = 0;
            for ($i=0, $n=count( $this->items ); $i < $n; $i++) {
                $row = &$this->items[$i];
                $checked 	= JHTML::_('grid.id',   $i, $row->resoluciones_id );
                $link 		= JRoute::_( 'index.php?option=com_reghs&controller=resolucion&task=edit&cid[]='. $row->resoluciones_id );
                ?>
            <tr class="<?php echo "row$k"; ?>">
                <td>
                        <?php echo $checked; ?>
                </td>
                <td>
                    <a href="<?php echo $link; ?>"><?php echo $row->numero; ?></a>
                </td>
                <td>
                        <?php echo $row->fecha_resolucion; ?>
                </td>
                <td>
                        <?php echo $row->vigencia_desde; ?>
                </td>
                <td>
                        <?php echo $row->vigencia_hasta; ?>
                </td>
                <td>
                        <?php
                        //muestro solo una parte del texto
                        echo substr($row->visto, 0, 20)."...";
                        ?>
                </td>
                <td>
                        <?php
                        echo substr($row->considerando, 0, 20)."...";
                        ?>
                </td>
                <td>
                        <?php
                        echo substr($row->observaciones, 0, 10)."...";
                        ?>
                </td>
                <td>
                        <?php echo $row->materia; ?>
                </td>
                <td>
                        <?php echo $row->cargo; ?>
                </td>
                <td>
                        <?php echo $row->agente; ?>
                </td>
            </tr>
                <?php

                $k = 1 - $k;
            }
            ?>
        </table>
    </div>

    <input type="hidden" name="option" value="com_reghs" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="boxchecked" value="0" />
    <input type="hidden" name="controller" value="resolucion" />
</form>

